home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 24 / AMIGAplus Sonderheft 24 (2000)(Falke)(DE)[!].iso / PublicDomain / Anwendungen / MT-RechnungIII / Rexx / FWRegistrierung.brarexx < prev    next >
Text File  |  1998-11-16  |  6KB  |  285 lines

  1. /*
  2. ** Druck-, Vorschau, Sichern eines Registrierungsformulars mit Hilfe von FinalWriter
  3. ** $VER: FWRegistrerung.brarexx V1.00 (16.11.98)
  4. */
  5.  
  6.  
  7. PARSE ARG ARexxPort;
  8.  
  9. ADDRESS VALUE ARexxPort;
  10. OPTIONS RESULTS;
  11.  
  12. FWVorlage    = "FWDokumente/Registrierung.fw";
  13. FWDokument    = "t:Registrierung.fw";
  14. FWPort        = "FINALW."
  15.  
  16. LF                = '0a'x;                            /* Zeilenvorschub                */
  17.  
  18. Gefunden = 0;
  19. DO i = 1 TO 20 WHILE(Gefunden = 0)
  20.     IF show(ports, (FWPort || i)) THEN
  21.         DO;
  22.             Gefunden = 1;
  23.             FWPort     = FWPort || i;
  24.         END;
  25. END;
  26.  
  27. IF Gefunden = 0 THEN
  28.     DO;
  29.         ES_TITLE                = "Warnung";
  30.         ES_TEXTFORMAT        = "FinalWriter ist nicht aktiv, bitte starten sie dieses" || LF || "und versuchen Sie es erneut";
  31.         ES_GADGETFORMAT    = "Abbrechen";
  32.         EASY_REQUEST;
  33.         EXIT;
  34.     END;
  35.  
  36. /* Original FW-Dokument nach t: kopieren, um ein versehentliches überschreiben */
  37. /* dieser Vorlage zu verhindern */
  38. GET_REXXPATH;
  39. FWVorlage        = MTR_RESULT || FWVorlage;
  40. ADDRESS COMMAND "copy" FWVorlage FWDokument;
  41.  
  42. /* Oberfläche sperren */
  43. LOCKGUI;
  44.  
  45. /* Art ermitteln: 0 = Drucken, 1 = Vorschau, 2 = Speichern */
  46. PRINTSTATE;
  47. Druckart = MTR_RESULT;
  48.  
  49. Ende_Kennzeichen = 'N';
  50.  
  51. /* Suchen der zu druckenden Daten */
  52. PRINTFIND;
  53.  
  54. DO WHILE( MTR_RESULT > 0 & Ende_Kennzeichen = 'N');
  55.     ADDRESS VALUE FWPort;
  56.     SCREENTOFRONT;
  57.  
  58.     CALL DatenAufbereiten;
  59.     SELECT;
  60.         WHEN Druckart = 0 THEN    /* Drucken    */
  61.             DO;
  62.                 ADDRESS VALUE FWPort;
  63.                 PRINT;
  64.                 ADDRESS VALUE ARexxPort;
  65.                 MTSCREENTOFRONT;
  66.             END;
  67.         WHEN Druckart = 1 THEN    /* Vorschau    */
  68.             ADDRESS VALUE ARexxPort;
  69.         WHEN Druckart = 2 THEN    /* Sichern    */
  70.             DO;
  71.                 ADDRESS VALUE FWPort;
  72.                 SAVEAS;
  73.                 ADDRESS VALUE ARexxPort;
  74.                 MTSCREENTOFRONT;
  75.             END;
  76.         OTHERWISE
  77.             DO;
  78.                 ES_TITLE                = "Warnung";
  79.                 ES_TEXTFORMAT        = "Druckart wird nicht unterstützt!";
  80.                 ES_GADGETFORMAT    = "Ok";
  81.                 EASY_REQUEST;
  82.                 Ende_Kennzeichen    = 'J';
  83.             END;
  84.     END;
  85.  
  86.     PRINTFIND;
  87. END;
  88.  
  89. /* WordWorth-Datei aus t: wieder entfernen */
  90. ADDRESS COMMAND "delete" FWDokument;
  91.  
  92. /* Oberfläche wieder entsperren */
  93. ADDRESS VALUE ARexxPort;
  94. FREEGUI;
  95.  
  96. EXIT;
  97.  
  98. DatenAufbereiten:
  99.  
  100.     ADDRESS VALUE ARexxPort;
  101.  
  102.     FORMAT_DATE_LONG date(s);
  103.     PRINTDATE = MTR_RESULT;
  104.  
  105.     NAME_OF_SALUTATION OFFICE.ADDRESS.SALUTATION;
  106.     ZW_Anrede = MTR_RESULT;
  107.  
  108.     IF OFFICE.ADDRESS.BANK_CODE_NUMBER = "0" THEN
  109.         OFFICE.ADDRESS.BANK_CODE_NUMBER = " ";
  110.  
  111.     GET_COUNTRY OFFICE.ADDRESS.COUNTRY_NUMBER;
  112.  
  113.     FORMAT_DATE_LONG OFFICE.ADDRESS.BIRTHDAY;
  114.     ZW_BIRTHDAY    = MTR_RESULT;
  115.     
  116.  
  117.     ADDRESS VALUE FWPort;
  118.     CLEARDOC;
  119.     OPEN FWDokument;
  120.  
  121.     DruckString    = OFFICE.ADDRESS.ADDRESS.2 || LF;
  122.     i = INDEX( DruckString, LF);
  123.     IF i > 0 THEN
  124.         DO;
  125.             DruckTeil    = LEFT( DruckString, (i - 1) );
  126.             DruckString = SUBSTR(DruckString, (i + 1) );
  127.             i = INDEX( DruckString, LF);
  128.         END;
  129.     ELSE
  130.         DruckTeil    = DruckString;
  131.     FIND "<OFFICE.ADDRESS.2>";
  132.     FINDNEXT;
  133.     STATUS LinePos;
  134.     PARSE VAR RESULT BegLine BegPosition EndLine EndPosition;
  135.     TYPE DruckTeil;
  136.     FIND "<PRINTDATE>"
  137.     TYPE PRINTDATE;
  138.  
  139.     DO WHILE( i > 0 );
  140.         DruckTeil    = LEFT( DruckString, (i - 1) );
  141.         DruckString = SUBSTR(DruckString, (i + 1) );
  142.         BegLine        = BegLine + 1;
  143.         MoveToLine BegLine 0;
  144.         TYPE DruckTeil;
  145.         i = INDEX( DruckString, LF);
  146.     END;
  147.  
  148.     FIND "<OFFICE.ADDRESS.ADDRESS.0>";
  149.     TYPE OFFICE.ADDRESS.ADDRESS.0;
  150.  
  151.     FIND "<OFFICE.ADDRESS.SALUTATION>";
  152.     TYPE ZW_Anrede;
  153.  
  154.     FIND "<OFFICE.ADDRESS.SURNAME>";
  155.     IF OFFICE.ADDRESS.SURNAME = "" THEN
  156.         TYPE " ";
  157.     ELSE
  158.         TYPE OFFICE.ADDRESS.SURNAME;
  159.  
  160.     FIND "<OFFICE.ADDRESS.PRENAME>";
  161.     IF OFFICE.ADDRESS.PRENAME = "" THEN
  162.         TYPE " ";
  163.     ELSE
  164.         TYPE OFFICE.ADDRESS.PRENAME;
  165.  
  166.     FIND "<OFFICE.ADDRESS.COMPANY1>";
  167.     IF OFFICE.ADDRESS.COMPANY1 = "" THEN
  168.         TYPE " ";
  169.     ELSE
  170.         TYPE OFFICE.ADDRESS.COMPANY1;
  171.  
  172.     FIND "<OFFICE.ADDRESS.COMPANY2>";
  173.     IF OFFICE.ADDRESS.COMPANY2 = "" THEN
  174.         TYPE " ";
  175.     ELSE
  176.         TYPE OFFICE.ADDRESS.COMPANY2;
  177.  
  178.     FIND "<OFFICE.ADDRESS.STREET>";
  179.     IF OFFICE.ADDRESS.STREET = "" THEN
  180.         TYPE " ";
  181.     ELSE
  182.         TYPE OFFICE.ADDRESS.STREET;
  183.  
  184.     FIND "<OFFICE.ADDRESS.ZIP>";
  185.     IF OFFICE.ADDRESS.ZIP = "" THEN
  186.         TYPE " ";
  187.     ELSE
  188.         TYPE OFFICE.ADDRESS.ZIP;
  189.  
  190.     FIND "<OFFICE.ADDRESS.CITY>";
  191.     IF OFFICE.ADDRESS.CITY = "" THEN
  192.         TYPE " ";
  193.     ELSE
  194.         TYPE OFFICE.ADDRESS.CITY;
  195.  
  196.     FIND "<COUNTRY.NAME>";
  197.     IF COUNTRY.NAME = "" THEN
  198.         TYPE " ";
  199.     ELSE
  200.         TYPE COUNTRY.NAME;
  201.  
  202.     i = OFFICE.ADDRESS.STATE_NUMBER;
  203.     FIND "<COUNTRY.STATE>";
  204.     IF COUNTRY.STATE.i = "" THEN
  205.         TYPE " ";
  206.     ELSE
  207.         TYPE COUNTRY.STATE.i;
  208.  
  209.     FIND "<OFFICE.ADDRESS.PHONE>";
  210.     IF OFFICE.ADDRESS.PHONE = "" THEN
  211.         TYPE " ";
  212.     ELSE
  213.         TYPE OFFICE.ADDRESS.PHONE;
  214.  
  215.     FIND "<OFFICE.ADDRESS.FAX>";
  216.     IF OFFICE.ADDRESS.FAX = "" THEN
  217.         TYPE " ";
  218.     ELSE
  219.         TYPE OFFICE.ADDRESS.FAX;
  220.  
  221.     FIND "<OFFICE.ADDRESS.EDI>";
  222.     IF OFFICE.ADDRESS.EDI = "" THEN
  223.         TYPE " ";
  224.     ELSE
  225.         TYPE OFFICE.ADDRESS.EDI;
  226.  
  227.     FIND "<OFFICE.ADDRESS.EMAIL.0>";
  228.     IF OFFICE.ADDRESS.EMAIL.0 = "" THEN
  229.         TYPE " ";
  230.     ELSE
  231.         TYPE OFFICE.ADDRESS.EMAIL.0;
  232.  
  233.     FIND "<OFFICE.ADDRESS.EMAIL.1>";
  234.     IF OFFICE.ADDRESS.EMAIL.1 = "" THEN
  235.         TYPE " ";
  236.     ELSE
  237.         TYPE OFFICE.ADDRESS.EMAIL.1;
  238.  
  239.     FIND "<OFFICE.ADDRESS.EMAIL.2>";
  240.     IF OFFICE.ADDRESS.EMAIL.2 = "" THEN
  241.         TYPE " ";
  242.     ELSE
  243.         TYPE OFFICE.ADDRESS.EMAIL.2;
  244.  
  245.     FIND "<OFFICE.ADDRESS.BANK_CODE_NUMBER>";
  246.     IF OFFICE.ADDRESS.BANK_CODE_NUMBER = "" THEN
  247.         TYPE " ";
  248.     ELSE
  249.         TYPE OFFICE.ADDRESS.BANK_CODE_NUMBER;
  250.  
  251.     FIND "<OFFICE.ADDRESS.BANK_NAME>";
  252.     IF OFFICE.ADDRESS.BANK_NAME = "" THEN
  253.         TYPE " ";
  254.     ELSE
  255.         TYPE OFFICE.ADDRESS.BANK_NAME;
  256.  
  257.     FIND "<OFFICE.ADDRESS.BANK_SHORT>";
  258.     IF OFFICE.ADDRESS.BANK_SHORT = "" THEN
  259.         TYPE " ";
  260.     ELSE
  261.         TYPE OFFICE.ADDRESS.BANK_SHORT;
  262.  
  263.     FIND "<OFFICE.ADDRESS.ACCOUNT>";
  264.     IF OFFICE.ADDRESS.ACCOUNT = "" THEN
  265.         TYPE " ";
  266.     ELSE
  267.         TYPE OFFICE.ADDRESS.ACCOUNT;
  268.  
  269.     FIND "<OFFICE.ADDRESS.BIRTHDAY>";
  270.     IF ZW_BIRTHDAY = "" THEN
  271.         TYPE " ";
  272.     ELSE
  273.         TYPE ZW_BIRTHDAY;
  274.  
  275.     IF OFFICE.ADDRESS.SURNAME = "" THEN
  276.         ZW_SUR_PRENAME    = "Unterschrift";
  277.     ELSE
  278.         ZW_SUR_PRENAME    = OFFICE.ADDRESS.PRENAME  OFFICE.ADDRESS.SURNAME;
  279.  
  280.     FIND "<OFFICE.SUR_PRENAME>";
  281.     TYPE ZW_SUR_PRENAME;
  282.  
  283. RETURN;
  284.  
  285.